package com.zly.android.architectural.pattern.mvvm

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.viewbinding.ViewBinding

abstract class BaseActivity<VB:ViewBinding,VM:ViewModel>:AppCompatActivity() {
     lateinit var binding: VB
     lateinit var mViewModel: VM
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        binding=setBinding()
        mViewModel=setViewModel()
        ViewModelProvider(this)[mViewModel::class.java]
    }

    abstract fun setBinding():VB

    abstract fun setViewModel():VM
}